package com.twl.app.base.bo;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.twl.app.base.entity.Dispatchmanger;
import com.twl.app.base.entity.Dutyback;
import com.twl.app.base.entity.Dutycount;
import com.twl.app.base.entity.Dutydeduct;
import com.twl.app.base.entity.Dutymeals;
import com.twl.app.base.entity.Dutymoney;
import com.twl.app.base.entity.Dutysendmoney;
import com.twl.app.base.entity.Jbsalary;
import com.twl.app.base.entity.Jsbfmoney;
import com.twl.app.base.entity.Leavebmoney;
import com.twl.app.base.entity.Loyalward;
import com.twl.app.base.entity.Moneyadjust;
import com.twl.app.base.entity.Overtimemeals;
import com.twl.app.base.entity.Overtimemoney;
import com.twl.app.base.entity.Perreportduty;
import com.twl.app.base.entity.Personalduty;
import com.twl.app.base.entity.Personalmoney;
import com.twl.app.base.entity.Secureunit;
import com.twl.app.base.entity.Shiftallowance;
import com.twl.app.base.entity.Solidmoney;
import com.twl.app.base.entity.Tradecost;
import com.twl.core.framework.bo.impl.AbsCrudBoImpl;
import com.twl.core.framework.dao.WSHibernateDaoSupportProxy;
import com.twl.core.framework.page.Page;
import com.twl.core.framework.page.Result;

/**
 * cms查询接口Bo
 * @author uatzhangxc
 *
 */
@Transactional
@Repository("cmsBo")
public class CmsBoImpl extends AbsCrudBoImpl{
	
	@Autowired
	private WSHibernateDaoSupportProxy wSHibernateDaoSupportProxy;
	
	/**
	 * 查询基本工资
	 * @param params
	 * @return
	 */
	public Result getJbsalary(Map<String, Object> params){
		//获取页参数信息
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Jbsalary where 1=1  ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}

	/**
	 * 查询补发工资（新进）
	 * @param params
	 * @return
	 * @throws IntrospectionException 
	 * @throws InvocationTargetException 
	 * @throws InstantiationException 
	 * @throws IllegalAccessException 
	 */
	//public List<Bfsalary> getBfSalary(Map<String, Object> params) {
	public Result getBfSalary(Map<String, Object> params) {
		//获取页参数信息
		Page page = (Page) params.get("page");
		
		//FIXME 需要加条件的时候添加条件
		StringBuffer hql = new StringBuffer(" from Bfsalary  where 1=1  ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询补发工资（晋升）
	 * @param params
	 * @return
	 */
	public Result getJsbfmoney(Map<String, Object> params){
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Jsbfmoney where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 *  查询正式或者派遣离职-扣减
	 * @param params
	 * @return
	 */
	public Result getMoneyadjust(Map<String, Object> params){
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Moneyadjust where  1=1  ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	/**
	 * 查询请假扣款
	 * @param params
	 * @return
	 */
	public Result getLeavebmoney(Map<String, Object> params){
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Leavebmoney where  1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	/**
	 * 查询加班工资
	 * @param params
	 * @return
	 */
	public Result getOvertimemoney(Map<String, Object> params){
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Overtimemoney where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询加班餐补
	 * @param params
	 * @return
	 */
	public Result getOvertimemeals(Map<String, Object> params){
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Overtimemeals where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询轮班津贴
	 * @param params
	 * @return
	 */
	public Result getShiftallowance(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Shiftallowance where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询忠诚奖
	 * @param params
	 * @return
	 */
	public Result getLoyalward(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Loyalward where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询税前饭贴
	 * @param params
	 * @return派遣员工管理费
	 */
	public Result getDutymeals(Map<String, Object> params){
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Dutymeals where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询派遣员工管理费
	 * @param params
	 * @return
	 */
	public Result getDispatchmanger(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Dispatchmanger where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询保险单位金  Solidmoney
	 * @param params  
	 * @return
	 */
	public Result getSecureunit(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Secureunit where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 * 查询实发工资    
	 * @param params  
	 * @return
	 */
	public Result getSolidmoney(Map<String, Object> params){
		Page page = (Page) params.get("page");
		
		StringBuffer hql = new StringBuffer(" from Solidmoney where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 *  税后应发合计
	 * @param params  
	 * @return
	 */
	public Result getDutycount(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Dutycount where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 *  个人所得税（报税）
	 * @param params  
	 * @return
	 */
	public Result getPerreportduty(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Perreportduty where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}

	/**
	 *  个人所得税（报税）
	 * @param params  
	 * @return  
	 */
	public Result getPersonalduty(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Personalduty where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}

	/**
	 *  税后饭贴
	 * @param params  
	 * @return  
	 */
	public Result getDutyback(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Dutyback where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}

	/**
	 *  工会费
	 * @param params  
	 * @return  
	 */
	public Result getTradecost(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Tradecost where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}

	/**
	 *  税前应发工资
	 * @param params  
	 * @return  
	 */
	public Result getDutysendmoney(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Dutysendmoney where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 *  税前扣除
	 * @param params  
	 * @return  
	 */
	public Result getDutydeduct(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Dutydeduct where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 *  个人保险金
	 * @param params  
	 * @return  
	 */
	public Result getPersonalmoney(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Personalmoney where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	/**
	 *  税前工资
	 * @param params  
	 * @return  
	 */
	public Result getDutymoney(Map<String, Object> params){
		Page page = (Page) params.get("page");

		StringBuffer hql = new StringBuffer(" from Dutymoney where 1=1 ");
		String staffint =  params.get("staffint")==null?null:String.valueOf( params.get("staffint"));
		if(StringUtils.isNotBlank(staffint)){
			hql.append(" and staffint = '"+params.get("staffint")+"' ");
		}
		//FIXME 需要加条件的时候添加条件
		//获取带分页信息的结果集
		Result result = wSHibernateDaoSupportProxy.getListByPage(hql.toString(), page);
		return result ;
	}
	
	
	
}
